﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            textBox1.Leave += new EventHandler(textBox1_leave);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text=="")
            {


            }



        }

        private void textBox1_leave(object sender, EventArgs e)
        {
            SqlDataReader reade = null;
            string name=null;
            try{
                string sql = "insert into Newadd(Name, Pass) values('"+textBox1+"', '"+textBox2+"')";
                reade = SqlCommand.;
                while{

                }
            }
            catch(Exception ex)
            {
                MessageBox.Show("原因不明，请联系管理员");
            }
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                //textBox1.Text = "用户名";
            }
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox2_Leave(object sender, EventArgs e)
        {
            if (textBox2.Text == "")
            {
               // textBox2.Text = "密码";
            }
        }

        private void textBox2_Enter(object sender, EventArgs e)
        {
            if (textBox2.Text=="")
            {
              //  textBox2.Text = "密码";
            }
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }
    }
}
